package eventbus

import (
	"github.com/asaskevich/EventBus"
)

var (
	eventBus = EventBus.New()
)

func EventSubscribe(topic string, handler any) error {
	return eventBus.Subscribe(topic, handler)
}

func EventPublish(topic string, args ...any) {
	eventBus.Publish(topic, args...)
}

func EventUnsubscribe(topic string, handler any) {
	eventBus.Unsubscribe(topic, handler)
}

func EventSubscribeOnce(topic string, handler any) error {
	return eventBus.SubscribeOnce(topic, handler)
}
